<?php
/**
 * User: 1971229701@qq.com
 * Date: 2020/11/6/006
 * Time: 10:26
 */

namespace app\move\controller;


use app\Index\logic\ListsLogic;

class Lists extends Base
{
    public function index()
    {
        $title = $this->request->get('title');
        $price = $this->request->post('price');
        $pailiang = $this->request->post('pailiang');
        $qudong = $this->request->post('qudong');
        $r = (new ListsLogic())->listing($title, $price, $pailiang, $qudong);

        $this->assign('clist', $r['cList']);
        $this->assign('alist', $r['aList']);
        $this->assign('cate_list', $r['cate_list']);
        $this->assign('price', $r['price']);
        $this->assign('pailiang', $r['pailiang']);
        $this->assign('qudong', $r['qudong']);
        $this->assign('web_title', '车型展示');
        $this->assign('get',empty($title)?'128':$title);
        return $this->fetch();
    }

    public function search()
    {
        $title = $this->request->post('title');
        $price = $this->request->post('price');
        $pailiang = $this->request->post('pailiang');
        $qudong = $this->request->post('qudong');
        $r = (new ListsLogic())->search($title, $price, $pailiang, $qudong);
        return $r;
    }
    // 车型详情
    public function detail($id = 1)
    {

        $r = (new ListsLogic())->detail($id);
        $this->assign('info',$r['info']);
        $this->assign('banner',$r['banner']);
        $this->assign('liangdian',$r['liangdian']);
        $this->assign('list',$r['list']);
        $this->assign('web_title','车型详情');

        return $this->fetch();
    }
}